<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="即时挂载MySQL/MariaDB实例">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="ZH-CN_TOPIC_0000001792503262">
<meta name="DC.Language" content="zh-cn">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>即时挂载MySQL/MariaDB实例</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="ZH-CN_TOPIC_0000001792503262"></a><a name="ZH-CN_TOPIC_0000001792503262"></a>

<h1 class="topictitle1">即时挂载MySQL/MariaDB实例</h1>
<div><p>当需要将单实例的副本挂载至原位置或新位置以快速启动一个新服务时，可参考本节配置即时挂载。</p>
<div class="section"><h4 class="sectiontitle">背景信息</h4><p>挂载至的目标主机已安装ProtectAgent及其他相关软件。</p>
<p>具体操作可参考<span>《OceanProtect <span id="ZH-CN_TOPIC_0000001792503262__zh-cn_topic_0000001792502994_ph19170214112011">备份一体机 1.5.0-1.6.0</span> ProtectAgent安装指南》</span>。</p>
</div>
<div class="section"><h4 class="sectiontitle">挂载前准备</h4><p><strong>设置mysqld环境变量</strong></p>
<ol><li>登录数据库主机，执行<strong>mysqld --help</strong>命令，查看环境变量是否存在。<p>如果输出<strong>-bash: mysqld: command not found</strong>，请执行<a href="#ZH-CN_TOPIC_0000001792503262__li1118201114363">2</a>配置环境变量，反之已存在环境变量。</p>
</li><li id="ZH-CN_TOPIC_0000001792503262__li1118201114363"><a name="ZH-CN_TOPIC_0000001792503262__li1118201114363"></a><a name="li1118201114363"></a>进入安装目录下的<strong>mysqld</strong>文件，执行<strong>ln -s /<em>安装目录</em>/bin/mysqld /usr/sbin/mysqld</strong>命令，设置环境变量。</li></ol>
<p><strong>设置mysqladmin环境变量</strong></p>
<ol><li>登录数据库主机，执行<strong>mysqladmin --help</strong>命令，查看环境变量是否存在。<p>如果输出<strong>-bash: mysqladmin: command not found</strong>，请执行<a href="#ZH-CN_TOPIC_0000001792503262__li9975193563716">2</a>配置环境变量，反之已存在环境变量。</p>
</li><li id="ZH-CN_TOPIC_0000001792503262__li9975193563716"><a name="ZH-CN_TOPIC_0000001792503262__li9975193563716"></a><a name="li9975193563716"></a>进入安装目录下的<strong>mysqladmin</strong>文件，执行<strong>ln -s /<em>安装目录</em>/bin/mysqladmin /usr/bin/mysqladmin</strong>命令，设置环境变量。</li></ol>
</div>
<div class="section"><h4 class="sectiontitle">操作步骤</h4><ol><li><span>选择<span class="uicontrol" id="ZH-CN_TOPIC_0000001792503262__zh-cn_topic_0000001839142377_uicontrol182851717133612">“<span id="ZH-CN_TOPIC_0000001792503262__zh-cn_topic_0000001839142377_text82855177369">数据利用</span> &gt; <span id="ZH-CN_TOPIC_0000001792503262__zh-cn_topic_0000001839142377_text52851317183617">即时挂载</span> &gt; <span id="ZH-CN_TOPIC_0000001792503262__zh-cn_topic_0000001839142377_text1183214450365">MySQL/MariaDB</span>”</span>。</span></li></ol><ol start="2"><li><span>单击<span class="uicontrol">“<span>创建</span>”</span>。</span></li><li><span>在<span class="uicontrol">“<span>选择资源</span>”</span>页签，选择要挂载的副本对应的资源，单击<span class="uicontrol">“<span>下一步</span>”</span>。</span></li><li><span>在<span class="uicontrol">“<span>选择副本</span>”</span>页签执行如下操作：</span><p><ol type="a"><li>选择要挂载的副本。<ul><li>创建即时挂载的副本必须是<span class="uicontrol">“<span>正常</span>”</span>状态。</li><li>备份部分磁盘生成的副本不支持即时挂载。</li></ul>
</li><li>选择已创建的挂载更新策略。<p>如果未在此处选择挂载更新策略，后续可<a href="zh-cn_topic_0000001839142709.html">通过修改操作配置挂载更新策略</a>。</p>
</li><li>单击<span class="uicontrol">“<span>下一步</span>”</span>。</li></ol>
</p></li><li><span>在<span class="uicontrol">“<span>挂载选项</span>”</span>页签，配置挂载参数，单击<span class="uicontrol">“<span>下一步</span>”</span>。</span><p><ol type="a"><li>配置即时挂载基本参数和高级参数。<div class="p">相关参数说明如<a href="#ZH-CN_TOPIC_0000001792503262__zh-cn_topic_0000001387707949_table89615043315">表1</a>所示。<div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><ul><li>带宽与IOPS可以任意配置一个或者两个都配置，如果是带宽型业务，建议只配置带宽，如果是IOPS型业务，建议只配置IOPS，如果不确定或者有时是带宽型、有时是IOPS型，则建议两个都配置，此时流量控制以小的一个为准。</li><li>标准IOPS(8KB)与真实IO模型的换算关系可以通过界面上的换算表查看。</li><li>通过限制挂载副本的最大流量，以保证备份、恢复任务的性能；设置挂载副本的下限保障，以保证挂载副本的最低性能。</li></ul>
</div></div>

<div class="tablenoborder"><a name="ZH-CN_TOPIC_0000001792503262__zh-cn_topic_0000001387707949_table89615043315"></a><a name="zh-cn_topic_0000001387707949_table89615043315"></a><table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001792503262__zh-cn_topic_0000001387707949_table89615043315" frame="border" border="1" rules="all"><caption><b>表1 </b>即时挂载参数说明</caption><colgroup><col style="width:15.459999999999999%"><col style="width:13.68%"><col style="width:70.86%"></colgroup><thead align="left"><tr><th align="left" class="cellrowborder" colspan="2" valign="top" id="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1"><p>参数</p>
</th>
<th align="left" class="cellrowborder" valign="top" id="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.2"><p>说明</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" colspan="2" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>位置</span></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.2 "><p>挂载到的目标主机位置。</p>
</td>
</tr>
<tr><td class="cellrowborder" rowspan="3" valign="top" width="15.459999999999999%" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>带宽（MB/s）</span></p>
<p></p>
<p></p>
<p></p>
</td>
<td class="cellrowborder" valign="top" width="13.68%" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>Min</span></p>
</td>
<td class="cellrowborder" valign="top" width="70.86%" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.2 "><p>即时挂载副本的最小带宽。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>Max</span></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p>即时挂载副本的最大带宽。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>Burst</span></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p>即时挂载副本的最大突发IOPS，<span>Burst</span>的取值必须大于Max。</p>
<p>当设置Max的值后，才支持设置<span>Burst</span>。</p>
</td>
</tr>
<tr><td class="cellrowborder" rowspan="3" valign="top" width="15.459999999999999%" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>标准IOPS（8KB）</span></p>
<p></p>
<p></p>
</td>
<td class="cellrowborder" valign="top" width="13.68%" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>Min</span></p>
</td>
<td class="cellrowborder" valign="top" width="70.86%" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.2 "><p>即时挂载副本平均每秒标准I/O的最小请求个数。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>Max</span></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p>即时挂载副本平均每秒标准I/O的最大请求个数。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>Burst</span></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p>即时挂载副本的最大突发IOPS，<span>Burst</span>的取值必须大于Max。</p>
<p>当设置Max的值后，才支持设置<span>Burst</span>。</p>
</td>
</tr>
<tr><td class="cellrowborder" colspan="2" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>最大Burst时间(秒)</span></p>
<p></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.2 "><p>当设置了带宽或标准IOPS的Burst参数，才需要设置该参数。表示突发带宽或突发IOPS的最大持续时间。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="15.459999999999999%" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>标准化时延（8KB）</span></p>
</td>
<td class="cellrowborder" valign="top" width="13.68%" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>Max</span></p>
</td>
<td class="cellrowborder" valign="top" width="70.86%" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.2 "><p>在本地阵列的最大时延。</p>
</td>
</tr>
<tr><td class="cellrowborder" colspan="2" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>挂载前执行脚本</span></p>
</td>
<td class="cellrowborder" rowspan="3" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.2 "><p>您可以根据实际需求，在挂载任务执行前、执行成功后、执行失败后，执行自定义脚本。</p>
<p>此处请输入脚本称，并确保登录数据库主机的用户对该脚本有可执行权限。</p>
<p>非Windows OS支持的脚本类型为“.sh”，如输入：<strong>/opt/script.sh</strong>。</p>
<div class="note"><span class="notetitle"> 说明： </span><div class="notebody"><p><span style="color:#282B33;">请将脚本放在ProtectAgent环境的/opt/DataBackup/ProtectClient/ProtectClient-E/sbin/thirdparty目录下。</span></p>
</div></div>
</td>
</tr>
<tr><td class="cellrowborder" colspan="2" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>挂载成功执行脚本</span></p>
</td>
</tr>
<tr><td class="cellrowborder" colspan="2" valign="top" headers="mcps1.3.4.3.4.2.1.1.1.3.2.4.1.1 "><p><span>挂载失败执行脚本</span></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</li><li>单击<span class="uicontrol">“<span>下一步</span>”</span>。</li></ol>
</p></li><li><span>预览挂载参数，确认无误后，单击<span class="uicontrol">“<span>完成</span>”</span>。</span><p><div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p>副本生成后立即用该副本执行即时挂载，可能会由于副本仍处于初始化状态而导致挂载任务失败，请3分钟后重试。</p>
</div></div>
</p></li></ol>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">版权所有 &copy; 华为技术有限公司</div></body>
</html>